package com.shrct.businessprocess.customerservice.impl;

import com.shrct.businessprocess.customerservice.RCWorkItem;
import com.shrct.businessprocess.customerservice.proxy.RCWorkItemProxy;
import edu.fudan.mylang.pf.BaseModelObject;
import edu.fudan.mylang.pf.IObjectFactory;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.hibernate.annotations.DiscriminatorOptions;

@Entity
@DiscriminatorValue("RCWORKITEM_TYPE")
@DiscriminatorOptions(force = true)
@DiscriminatorColumn(length = 64)
@Table(name = "rcworkitem")
public class RCWorkItemImpl extends BaseModelObject implements RCWorkItem {
  public RCWorkItemImpl() {
    super();
  }
  
  public static RCWorkItem create(final IObjectFactory objectFactory) {
    com.shrct.businessprocess.customerservice.RCWorkItem rCWorkItem = new com.shrct.businessprocess.customerservice.impl.RCWorkItemImpl(
    );
    objectFactory.create(rCWorkItem);
    return rCWorkItem;			
    
  }
  
  public static RCWorkItem createRCWorkItemImpl(final IObjectFactory objectFactory, final Procedure1<RCWorkItem> init) {
    com.shrct.businessprocess.customerservice.RCWorkItem rCWorkItem = new com.shrct.businessprocess.customerservice.impl.RCWorkItemImpl(
    );
    objectFactory.create(rCWorkItem);
    init.apply(rCWorkItem);
    
    return rCWorkItem;			
    
  }
  
  public RCWorkItemProxy toProxy() {
    com.shrct.businessprocess.customerservice.proxy.RCWorkItemProxy proxy = new com.shrct.businessprocess.customerservice.proxy.RCWorkItemProxy();
    proxy.setId(this.getId());
    if(this instanceof edu.fudan.mylang.pf.INamedModelObject){
    	proxy.setName(((edu.fudan.mylang.pf.INamedModelObject)this).getEntityName());
    }
    return proxy;
    
  }
}
